package com.codesuc.aichat.chatHistory.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.codesuc.aichat.common.base.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

/**
* @Author: ZhangGongMing
* @CreateTime: 2025/09/23 12:56
* @Description: ChatHistory实体类
* @Version: 1.0
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "chat_history")
@Schema(title = "ChatHistory对象", description = "对话历史记录实体类")
public class ChatHistory extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
    * 主键ID
    */
    @Schema(name = "主键ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
    * 用户ID
    */
    @Schema(name = "用户ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
    * 角色ID
    */
    @Schema(name = "角色ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long roleId;

    /**
    * 对话内容
    */
    @Schema(name = "对话内容")
    private String content;

    /**
    * 是否用户发送：0-角色，1-用户
    */
    @Schema(name = "是否用户发送：0-角色，1-用户")
    private Integer isUser;

}